package com.ydsungan.springtest.service;

import com.ydsungan.springtest.pojo.User;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    public User findUserById(String userId){
        User user = new User();
        user.setPassword("qweasdzxc");
        user.setId("001");
        user.setUsername("root");
        return  user;
    }

    public User findByUsername(User login){
        if(!login.getUsername().equals("root")){
            return null;
        }else{
            User user = new User();
            user.setPassword("qweasdzxc");
            user.setId("001");
            user.setUsername("root");
            return  user;
        }

    }

}
